package com.prs.crm.domain.sale;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.stock.Product;

@Entity
@Table(name = "sale_salesContractDetail")
public class SalesContractDetail extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	private String name;

	@ManyToOne
	private Product product;

	@ManyToOne
	private SalesContract salesContract;

	/**
	 * 原价
	 */
	private Double originalCost;

	/**
	 * 现价
	 */
	private Double nowCost;
	/**
	 * 数量
	 */
	private int contractNum;

//	/**
//	 * 发货剩余数量
//	 */
//	private int sendContactNum;

	/**
	 * 折扣
	 */
	private Double rebate;
	/**
	 * 总价
	 */
	private Double totalPrice;
	/**
	 * 已发送数量
	 */
	@Column(columnDefinition = "Integer(50) default '0'")
	private int receivesNumber;
	/**
	 * 退货状态 0没有退 1退了但没有退完2退完了
	 */
	@Column(columnDefinition = "Integer(2) default '0'")
	private int returnSate;
	/**
	 * 
	 * 总的退货数量
	 */
	@Column(columnDefinition = "Integer(50) default '0'")
	private int returnNum;
	/**
	 * 发送状态
	 */
	@Column(columnDefinition = "Integer(2) default '0'")
	private int recivesState;
	/**
	 * 未发货退回数量
	 * @return
	 */
	@Column(columnDefinition = "Integer(50) default '0'")
	private int noReceiveNum;
	public int getReturnSate() {
		return returnSate;
	}

	public void setReturnSate(int returnSate) {
		this.returnSate = returnSate;
	}

	public int getReceivesNumber() {
		return receivesNumber;
	}

	public void setReceivesNumber(int receivesNumber) {
		this.receivesNumber = receivesNumber;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public SalesContract getSalesContract() {
		return salesContract;
	}

	public void setSalesContract(SalesContract salesContract) {
		this.salesContract = salesContract;
	}

	public Double getOriginalCost() {
		return originalCost;
	}

	public void setOriginalCost(Double originalCost) {
		this.originalCost = originalCost;
	}

	public Double getNowCost() {
		return nowCost;
	}

	public void setNowCost(Double nowCost) {
		this.nowCost = nowCost;
	}

	public int getContractNum() {
		return contractNum;
	}

	public void setContractNum(int contractNum) {
		this.contractNum = contractNum;
	}

	public Double getRebate() {
		return rebate;
	}

	public void setRebate(Double rebate) {
		this.rebate = rebate;
	}

	public Double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}

	public int getReturnNum() {
		return returnNum;
	}

	public void setReturnNum(int returnNum) {
		this.returnNum = returnNum;
	}


	public int getRecivesState() {
		return recivesState;
	}

	public void setRecivesState(int recivesState) {
		this.recivesState = recivesState;
	}

	public int getNoReceiveNum() {
		return noReceiveNum;
	}

	public void setNoReceiveNum(int noReceiveNum) {
		this.noReceiveNum = noReceiveNum;
	}

}
